#!/usr/bin/env python
#coding:utf-8
# author : wangwei
# mail   ：alsww@qq.com
# oldboy s10 python training

import sys
import os

from shopping import shoppingList
from printlist import printList
from withdraw import withDraw
from cashin import cashIn
from transfer_cash import transferCash

def menuShow(n,m):
    print "欢迎您：\033[1;31;40m%s\033[0m, 登录oldboy银行的ATM系统:" %n
    print "请选择以下序号，来完成您的操作:"
    print " 1. 购物"
    print " 2. 取现"
    print " 3. 还款"
    print " 4. 转账"
    print " 5. 打印消费记录"
    print " 6. 退出"
    input = int(raw_input("请输入 ：1 ~ 6 "))
    global current_user
    current_user = n
    m = menuSelect(input,m)
    return m

def menuSelect(input,money):
    if input == 1:
        money = shoppingList(current_user,money)
    if input == 2:
        money = withDraw(current_user,money)
    if input == 3:
        money = cashIn(current_user,money)
    if input == 4:
        money = transfer_cash(current_user,money)
    if input == 5:
        printList(current_user)
    if input == 6:
        print "\033[1;32;40m感谢您使用本ATM系统，再见!\033[0m"
        sys.exit()
    return money